$OpenBSD: patch-src_dspam_c,v 1.9 2013/09/14 17:12:12 landry Exp $
--- src/dspam.c.orig	Wed Apr 11 20:48:33 2012
+++ src/dspam.c	Sat Jan  5 16:11:50 2013
@@ -415,7 +415,7 @@ process_message (
       CTX->confidence = 1.0;
       STATUS("A virus was detected in the message contents");
       result = DSR_ISSPAM;
-      strcpy(CTX->class, LANG_CLASS_VIRUS);
+      strlcpy(CTX->class, LANG_CLASS_VIRUS, sizeof (CTX->class));
       internally_canned = 1;
       if(!_ds_match_attribute(agent_config, "TrackSources", "virus")) {
         if (!dspam_getsource (CTX, ip, sizeof (ip)))
@@ -433,7 +433,7 @@ process_message (
     CTX->result = DSR_ISSPAM;
     CTX->probability = 1.0;
     CTX->confidence = 1.0;
-    strcpy(CTX->class, LANG_CLASS_BLOCKLISTED);
+    strlcpy(CTX->class, LANG_CLASS_BLOCKLISTED, sizeof (CTX->class));
     internally_canned = 1;
   }
 
@@ -826,10 +826,10 @@ process_message (
 
     switch (CTX->result) {
       case DSR_ISSPAM:
-        strcpy(data, "Spam");
+        strlcpy(data, "Spam", sizeof (data));
         break;
       default:
-        strcpy(data, "Innocent");
+        strlcpy(data, "Innocent", sizeof (data));
         break;
     }
 
@@ -1114,7 +1114,7 @@ int tag_message(AGENT_CTX *ATX, ds_message_t message)
   int tagged = 0;
   char spam_subject[16];
 
-  strcpy(spam_subject, "[SPAM]");
+  strlcpy(spam_subject, "[SPAM]", sizeof (spam_subject));
   if (_ds_pref_val(ATX->PTX, "spamSubject")[0] != '\n' &&
       _ds_pref_val(ATX->PTX, "spamSubject")[0] != 0)
   {
@@ -1709,7 +1709,7 @@ int process_users(AGENT_CTX *ATX, buffer *message) {
     if (parse_message == NULL) {
       LOG(LOG_CRIT, ERR_MEM_ALLOC);
       presult->exitcode = ERC_PROCESS;
-      strcpy(presult->text, ERR_MEM_ALLOC);
+      strlcpy(presult->text, ERR_MEM_ALLOC, sizeof (presult->text));
 
       if (ATX->results) {
         nt_add(ATX->results, presult);
